﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script src="../src/utilFn.js"></script>
    <script src="../utilPackage/jquery-1.11.3.min.js"></script>
    <link href="../utilPackage/utilFn.css" rel="stylesheet" />
</head>
<body>
    <div class="subPage">
        <div class="subPage-title">
            Json常用的处理方法
        </div>
        <div class="subPage-sub-title"></div>

        <div id="extend" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>extend</strong> </span> <span class="title-type">Function(Boolen,Object/Array,Object/Array,...)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                 </span><span class="com">//*------JSON扩展，后面对象继承前面对象 --------*/ </span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                 </span><span class="com">//例如1：   </span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">};</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str0 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"zhoujingli"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"sex"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"男"</span><span class="pln"> </span><span class="pun">};</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">extend</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">,</span><span class="pln"> str0</span><span class="pun">);</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str2就是'{"id":"1","name":"zhoujingli","sex":"男"}';</span></code></li><li class="L7"><code class="lang-javascript"></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                 </span><span class="com">//例如2： </span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">},</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">}];</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str0 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[{</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"zhoujingli"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"sex"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"男"</span><span class="pln"> </span><span class="pun">}];</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">extend</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">,</span><span class="pln"> str0</span><span class="pun">);</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str2就是[{"id":"1","name":"zhoujingli","sex":"男"},{"id":"1","name":"gly"}];</span></code></li><li class="L3"><code class="lang-javascript"></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                 </span><span class="com">//例如3： </span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"32"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"ffff"</span><span class="pln"> </span><span class="pun">}</span><span class="pln"> </span><span class="pun">}];</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str0 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[{</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"zhoujingli"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"sex"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"男"</span><span class="pln"> </span><span class="pun">}];</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">extend</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">,</span><span class="pln"> str0</span><span class="pun">);</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str2就是[{"id":"1","name":"zhoujingli","sex":"男"}];</span></code></li><li class="L9"><code class="lang-javascript"></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                 </span><span class="com">//例如4： </span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">};</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str0 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"obj"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"32"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"ffff"</span><span class="pln"> </span><span class="pun">}</span><span class="pln"> </span><span class="pun">};</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">extend</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">,</span><span class="pln"> str0</span><span class="pun">);</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str2就是{"id":"1","name":"gly","obj":{"id":"32","name":"ffff"}};</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.extend(Boolen,Object1/Array1,Object2/Array2,...)//就是合并，后面的Object后继承 Boolen：默认为false<br />
                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入对象字符串（对象中用JSON.parse(String)）
                </div>
                <div style="padding:10px;">参数1<b>[Boolen]</b>：<input id="extendCanshu1" type="text" value="true" /></div>
                <div>
                    <textarea id="extendInput" class="InputTextarea">{"id":"1","name":"gly"}</textarea>
                </div>
                <div>
                    <textarea id="extendInput1" class="InputTextarea">{"name":"zhoujingli","sex":"男"}</textarea>
                </div>
                <div> <input id="extendButton" type="button" value="执行   g.extend(Boolen,Object1/Array1,Object2/Array2,...)" /> </div>
                <div>
                    显示结果  （对象中用JSON.stringify(Obj)）
                </div>
                <div>
                    <textarea id="extendOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#extendButton").click(function () {
                        var str1 = JSON.parse($('#extendInput').val());
                        var str2 = JSON.parse($('#extendInput1').val());
                        var canshu1 = eval($('#extendCanshu1').val());
                        var str3 = g.extend(canshu1, str1, str2);
                        $('#extendOutput').val(JSON.stringify(str3));
                    });
                </script>
            </div>
        </div>

        <div id="isEqual" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>isEqual</strong> </span> <span class="title-type">Function(Object/Array,Object/Array)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                 </span><span class="com">//*------两个Json是否一样 --------*/ </span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                 </span><span class="com">//例如1：   </span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">};</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str0 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">};</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">isEqual</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">,</span><span class="pln"> str0</span><span class="pun">);</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str2就是'true';</span></code></li><li class="L7"><code class="lang-javascript"></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                 </span><span class="com">//例如2：   </span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">};</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str0 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pun">,</span><span class="str">"sex"</span><span class="pun">:</span><span class="str">"男"</span><span class="pln"> </span><span class="pun">};</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">isEqual</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">,</span><span class="pln"> str0</span><span class="pun">);</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str2就是'false';</span></code></li><li class="L3"><code class="lang-javascript"></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                 </span><span class="com">//例如3：   </span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">}];</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str0 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">}];</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">isEqual</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">,</span><span class="pln"> str0</span><span class="pun">);</span></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str2就是'true';</span></code></li><li class="L9"><code class="lang-javascript"></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                 </span><span class="com">//例如4：   </span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">},</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"2"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">}];</span><span class="pln"> </span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str0 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"2"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">},</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">}];</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">isEqual</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">,</span><span class="pln"> str0</span><span class="pun">);</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str2就是'false';</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.isEqual(Object/Array,Object/Array)//两个Json是否是一样的<br />
                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入对象字符串<b>[Object/Array]</b>（对象中用JSON.parse(String)）
                </div>
                <div>
                    <textarea id="isEqualInput" class="InputTextarea">{"id":"1","name":"gly"}</textarea>
                </div>
                <div>
                    <textarea id="isEqualInput1" class="InputTextarea">{"id":"1","name":"gly"}</textarea>
                </div>
                <div> <input id="isEqualButton" type="button" value="执行 g.isEqual(Object/Array,Object/Array)" /> </div>
                <div>
                    显示结果
                </div>
                <div>
                    <textarea id="isEqualOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#isEqualButton").click(function () {
                        var str1 = JSON.parse($('#isEqualInput').val());
                        var str2 = JSON.parse($('#isEqualInput1').val());
                        var str3 = g.isEqual(str1, str2);
                        $('#isEqualOutput').val(str3);
                    });
                </script>
            </div>
        </div>

        <div id="Copy" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>Copy</strong> </span> <span class="title-type">Function(Object/Array)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                   </span><span class="com">//*------复制一个JSON --------*/ </span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                         </span><span class="com">//例如1：   </span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                        </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln">  </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">};</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="typ">Copy</span><span class="pln"> </span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                            </span><span class="com">//{ "id": "1", "name":  "gly" };</span></code></li><li class="L7"><code class="lang-javascript"></code></li><li class="L8"><code class="lang-javascript"><span class="pln">                         </span><span class="com">//例如2：   </span></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                        </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln">  </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">}];</span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="typ">Copy</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">);</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span><span class="pln"> </span><span class="com">//str2就是 [{ "id": "1", "name":  "gly" }];</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.Copy(Object/Array)//复制一个Json<br />
                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入对象字符串<b>[Object/Array]</b>（对象中用JSON.parse(String)）
                </div>
                <div>
                    <textarea id="CopyInput" class="InputTextarea">{"id":"1","name":"gly"}</textarea>
                </div>
                <div> <input id="CopyButton" type="button" value="执行 g.Copy(Object/Array)" /> </div>
                <div>
                    显示结果  （对象中用JSON.stringify(Obj)）
                </div>
                <div>
                    <textarea id="CopyOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#CopyButton").click(function () {
                        var str1 = JSON.parse($('#CopyInput').val());
                        var str3 = JSON.stringify(g.Copy(str1));
                        $('#CopyOutput').val(str3);
                    });
                </script>
            </div>
        </div>

        <div id="clearCertain" class="subPage-part">
            <div class="subPage-part-title"><span class="title-name">g.<strong>clearCertain</strong> </span> <span class="title-type">Function(Object/Array,Array)</span> </div>
            <div class="subPage-part-code">
                <pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code class="lang-javascript"></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                     </span><span class="com">//*------清理掉符号条件的属性 --------*/ </span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                         </span><span class="com">//例如1：   </span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                        </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">};</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">clearCertain </span><span class="pun">(</span><span class="pln">str1</span><span class="pun">,[</span><span class="lit">1</span><span class="pun">]);</span></code></li><li class="L5"><code class="lang-javascript"><span class="pln">                        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span></code></li><li class="L6"><code class="lang-javascript"><span class="pln">                            </span><span class="com">//{"name":  "gly" };</span></code></li><li class="L7"><code class="lang-javascript"><span class="pln">                            </span><span class="com">//值为1的属性全部清理掉</span></code></li><li class="L8"><code class="lang-javascript"></code></li><li class="L9"><code class="lang-javascript"><span class="pln">                         </span><span class="com">//例如2：   </span></code></li><li class="L0"><code class="lang-javascript"><span class="pln">                        </span><span class="kwd">var</span><span class="pln"> str1 </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[{</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"gly"</span><span class="pln"> </span><span class="pun">}];</span></code></li><li class="L1"><code class="lang-javascript"><span class="pln">                        </span><span class="kwd">var</span><span class="pln"> str2 </span><span class="pun">=</span><span class="pln"> g</span><span class="pun">.</span><span class="pln">clearCertain</span><span class="pun">(</span><span class="pln">str1</span><span class="pun">,[</span><span class="typ">String</span><span class="pun">]);</span></code></li><li class="L2"><code class="lang-javascript"><span class="pln">                        console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">str2</span><span class="pun">);</span></code></li><li class="L3"><code class="lang-javascript"><span class="pln">                            </span><span class="com">//str2就是 [{ }];</span></code></li><li class="L4"><code class="lang-javascript"><span class="pln">                            </span><span class="com">//所有String类型的全部清理掉</span></code></li></ol></pre>
            </div>
            <div class="subPage-part-explain">
                <tt>
                    g.clearCertain(Object/Array,Array1)
                    <br />//清理掉符号条件的属性 <br />
                    //默认Array1为 [null, undefined,""];
                    //Array1可以用具体的数值，也可以用(函数名)类名，比如：String,Number,Boolean,
                </tt>
            </div>
            <div class="subPage-part-explain">
                <div><b>测试方法</b></div>
                <div>
                    请输入对象字符串<b>[Object/Array]</b>（对象中用JSON.parse(String)）
                </div>
                <div>
                    <textarea id="clearCertainInput" class="InputTextarea" style="height:250px;">
                        {
                            "id": 1,
                            "name": "",
                            "sex": null,
                            "isHaveTel": true,
                            "family": {
                                "name": "别院",
                                "addr": "太湖"
                            },
                            "ary": [
                                1,
                                232,
                                null,
                                343
                            ]
                        }
                   </textarea>
                </div>
                <div>
                    参数1<b>[Array1]</b>
                </div>
                <div>
                    <textarea id="clearCertainCanshu1" class="InputTextarea">[null,""]</textarea>
                </div>
                <div> <input id="clearCertainButton" type="button" value="执行 g.clearCertain(Object/Array)" /> </div>
                <div>
                    显示结果  （对象中用JSON.stringify(Obj)）
                </div>
                <div>
                    <textarea id="clearCertainOutput" class="OutputTextarea"></textarea>
                </div>
                <script>
                    $("#clearCertainButton").click(function () {
                        var str1 = JSON.parse($('#clearCertainInput').val());
                        var canshu1 = JSON.parse($('#clearCertainCanshu1').val());
                        console.log(g.clearCertain(str1, canshu1));
                        var str3 = JSON.stringify(g.clearCertain(str1, canshu1));
                        $('#clearCertainOutput').val(str3);
                    });
                </script>
            </div>
        </div>



    </div>

</body>
</html>